package reflect;

/**
 * 通过反射访问注解
 */
public class ReflectDemo8 {
    public static void main(String[] args) {
        try {
            Class cls = Class.forName("reflect.Person");
            boolean mark = cls.isAnnotationPresent(AutoRunClass.class);
            if (mark){
                System.out.println("有注解");
            }else {
                System.out.println("没有注解");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
